package com.jd.ty.pojo;



public class Customer {
	private Long customerId;
	private String customerName;
	private String position;
	private String section;
	private String sex;
	private String phoneNumber;
	private String email;
	private CustomerCompany custCompany;

	public String getSection() {
		return section;
	}

	public void setSection(String section) {
		this.section = section;
	}

	public void linkToCompany(CustomerCompany custCompany) {
		setCustCompany(custCompany);
		custCompany.getCustomers().add(this);
	}

	public void unlinkCompany() {
		custCompany.getCustomers().remove(this);
		setCustCompany(null);
	}

	public Long getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Long customerId) {
		this.customerId = customerId;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public CustomerCompany getCustCompany() {
		return custCompany;
	}

	public void setCustCompany(CustomerCompany custCompany) {
		this.custCompany = custCompany;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getDetail() {
		StringBuilder sb = new StringBuilder();
		sb.append("职位:" + position + "<br>");
		if (section != null) {
			sb.append("部门:" + section + "<br>");
		}
		sb.append("性别:" + sex + "<br>");
		sb.append("电话:" + phoneNumber + "<br>");
		sb.append("邮箱地址:" + email + "<br>");

		return sb.toString();
	}
}
